# Maintainer: Rexct <rexct1 at gmail dot com>
# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Ronald van Haren <ronald.archlinux.org>
# Contributor: Thomas BU+FFFDchler <thomas.archlinux.org>

pkgbase=ntfs-3g_ntfsprogs
pkgname=ntfs-3g
pkgver=2013.1.13
pkgrel=4
pkgdesc="NTFS filesystem utilities"
arch=('sh4')
url="http://www.tuxera.com/community/ntfs-3g-download/"
license=('GPL2')
depends=('util-linux' 'fuse')
conflicts=('ntfsprogs')
provides=('ntfsprogs')
replaces=('ntfsprogs')
options=()
source=(http://tuxera.com/opensource/$pkgbase-$pkgver.tgz)
sha1sums=('8c12b7644d90ae9fb8d0aca0d7ebd5f8fac2c818')

prepare() {
  cd $pkgbase-$pkgver
  sed -i 's|$(DESTDIR)/sbin|$(DESTDIR)/usr/bin|' {ntfsprogs,src}/Makefile.in
}

build() {
  cd $pkgbase-$pkgver
  ./configure --prefix=/usr \
    --with-fuse=external --disable-static \
    --enable-posix-acls --disable-ldconfig\
    --mandir=/usr/share/man --sbin=/usr/bin \
    --enable-extras
  make
}

package_ntfs-3g() {
  cd $pkgbase-$pkgver
  make DESTDIR="$pkgdir" rootbindir=/usr/bin rootsbindir=/usr/bin rootlibdir=/usr/lib install
  ln -s /usr/bin/ntfs-3g "$pkgdir/usr/bin/mount.ntfs"
}
